package cn.wlinker.video.monitor.domain;

import java.util.Collections;
import java.util.List;

/**
 * @author gxsjx
 * @version 1.0
 * @date 2022/11/8
 */
@lombok.Data
public class Page<T> {
    protected List<T> records;
    protected long total;
    protected long size;
    protected long current;

    public Page() {
        this.records = Collections.emptyList();
        this.total = 0L;
        this.size = 10L;
        this.current = 1L;
    }

    public Page(long current, long size) {
        this(current, size, 0L);
    }

    public Page(long current, long size, long total) {
        this(current, size, total, true);
    }

    public Page(long current, long size, boolean searchCount) {
        this(current, size, 0L, searchCount);
    }

    public Page(long current, long size, long total, boolean searchCount) {
        this.records = Collections.emptyList();
        this.total = 0L;
        this.size = 10L;
        this.current = Math.max(current, 1L);

        this.size = size;
        this.total = total;
    }
}
